﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:l="clr-namespace:Faz.Dependencies">

    <!--
      The default styles used for the list.
    -->

    <!-- The template used for the default list - this template is not directly applied through
         default style to avoid impact on other views. -->
    <ControlTemplate x:Key="TemplateDefaultList"
                     TargetType="{x:Type ListView}">
        <Border BorderBrush="{l:ApplicationResource BrushBorder}"
                BorderThickness="1,1,1,0"
                SnapsToDevicePixels="True">
            <ItemsPresenter />
        </Border>
    </ControlTemplate>

    <!-- The template of the elements -->
    <DataTemplate x:Key="TemplateDefaultElement"
                  DataType="{x:Type l:AssemblyOverview}">
        <TextBlock VerticalAlignment="Center"
                   Margin="4,0,4,0">
                        <TextBlock Text="{Binding Path=Name}" />
                        <TextBlock Text="-" />
                        <TextBlock Text="{Binding Path=Level}" />
                    </TextBlock>
    </DataTemplate>

    <!-- The style of the cells -->
    <Style x:Key="StyleDefaultListItem"
           TargetType="{x:Type ListViewItem}">
        <Setter Property="Background"
                Value="{l:ApplicationResource BrushDefaultBackground}" />
        <Setter Property="Foreground"
                Value="{l:ApplicationResource BrushDefaultForeground}" />
        <Setter Property="BorderBrush"
                Value="{l:ApplicationResource BrushBorder}" />
        <Setter Property="BorderThickness"
                Value="0,0,0,1" />
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Style.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsFocused"
                               Value="False" />
                    <Condition Property="IsSelected"
                               Value="True" />
                </MultiTrigger.Conditions>
                <Setter Property="Background"
                        Value="{l:ApplicationResource BrushSelectedBackground}" />
                <Setter Property="Foreground"
                        Value="{l:ApplicationResource BrushSelectedForeground}" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsFocused"
                               Value="True" />
                    <Condition Property="IsSelected"
                               Value="True" />
                </MultiTrigger.Conditions>
                <Setter Property="Background"
                        Value="{l:ApplicationResource BrushFocusedBackground}" />
                <Setter Property="Foreground"
                        Value="{l:ApplicationResource BrushFocusedForeground}" />
            </MultiTrigger>
        </Style.Triggers>
    </Style>

    <!-- The style of the list -->
    <Style x:Key="StyleDefaultList"
           TargetType="{x:Type ListView}">
        <Setter Property="ItemTemplate"
                Value="{StaticResource TemplateDefaultElement}" />
        <Setter Property="ItemContainerStyle"
                Value="{StaticResource StyleDefaultListItem}" />
    </Style>

</ResourceDictionary>